package com.example.placean.service.impl;

import com.example.food.domain.Goods;
import com.example.food.domain.CoffeeTaste;
import com.example.placean.domain.dto.PriceDto;
import com.example.placean.service.PlaceAnService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class PlaceAnServiceImpl implements PlaceAnService {

    @Override
    public Map<String, Object> getPrice(PriceDto priceDto) {
        Goods c12 = priceDto.getCoffeeBean();
        CoffeeTaste c123 = priceDto.getCoffeeTaste();
        Order co = new Coffee(c12);
        co = new Coffee(c12);
        co = new TasteDecorator(co,c123);
        Map<String,Object> map  = new HashMap<String,Object>();
        map.put("price",co.cost());
        return map;
    }
}
